/* CacheArchive - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */

public class CacheArchive extends Class9 {
	public static JString aClass3_1281;
	public CacheIO aClass6_1282;
	public static int anInt1283;
	public volatile boolean[] aBooleanArray1284;
	public static Class39_Sub5_Sub3 aClass39_Sub5_Sub3_1285;
	public static JString aClass3_1286;
	public static int anInt1287 = -1;
	public boolean aBoolean1288 = false;
	public static JString aClass3_1289;
	public static int anInt1290;
	public static JString aClass3_1291;
	public static JString aClass3_1292;
	public static JString aClass3_1293;
	public CacheIO aClass6_1294;
	public static int[] anIntArray1295;
	public static Class39_Sub5_Sub10_Sub4[] aClass39_Sub5_Sub10_Sub4Array1296;
	public volatile boolean aBoolean1297 = false;
	public int anInt1298;
	public static JString aClass3_1299;
	public int anInt1300 = -1;
	public int anInt1301;
	public static volatile int anInt1302;
	public static int anInt1303;

	public int method169(int i) {
		int i_0_ = 0;
		int i_1_ = 0;
		for (int i_2_ = 0; aByteArrayArray137.length > i_2_; i_2_++) {
			if (anIntArray134[i_2_] > 0) {
				i_1_ += method171((byte) -114, i_2_);
				i_0_ += 100;
			}
		}
		if (i_0_ == 0)
			return 100;
		int i_3_ = i_1_ * 100 / i_0_;
		return i_3_;
	}

	public void method170(int i, int i_4_) {
		anInt1301 = i_4_;
		if (aClass6_1294 == null)
			Class39_Sub10.method866(anInt1298, this, 255, true, anInt1301, (byte) 98, (byte) 0);
		else
			OnDemandFetcher.method1118(this, (byte) -116, aClass6_1294, anInt1298);
	}

	public void method147(boolean bool, int i) {
		Class39_Sub5_Sub4_Sub1.method495(bool, anInt1298, i);
	}

	public int method171(byte i, int i_5_) {
		if (i > -98)
			return -95;
		if (aByteArrayArray137[i_5_] != null)
			return 100;
		if (aBooleanArray1284[i_5_])
			return 100;
		return Class30.method319(anInt1298, i_5_, -20500);
	}

	public static Class39_Sub5_Sub6 method172(int i, int i_6_) {
		Class39_Sub5_Sub6 class39_sub5_sub6 = ((Class39_Sub5_Sub6) Class39_Sub5_Sub4_Sub4_Sub1.aClass7_2490.method133((byte) -118, (long) i));
		if (i_6_ != 3)
			return null;
		if (class39_sub5_sub6 != null)
			return class39_sub5_sub6;
		byte[] is = Stream.aClass9_1362.method165(i_6_ + 30602, 3, i);
		class39_sub5_sub6 = new Class39_Sub5_Sub6();
		if (is != null)
			class39_sub5_sub6.method582((byte) -9, new Stream(is));
		Class39_Sub5_Sub4_Sub4_Sub1.aClass7_2490.method135(class39_sub5_sub6, (long) i, (byte) 98);
		return class39_sub5_sub6;
	}

	public void method149(byte i, int i_7_) {
		if (i != 90)
			method147(false, -85);
		if (aClass6_1282 != null && aBooleanArray1284 != null && aBooleanArray1284[i_7_])
			OnDemandFetcher.method1118(this, (byte) -107, aClass6_1282, i_7_);
		else
			Class39_Sub10.method866(i_7_, this, anInt1298, true, anIntArray145[i_7_], (byte) 118, (byte) 2);
	}

	public void method173(byte[] is, int i, boolean bool, CacheIO class6, byte i_8_) {
		if (aClass6_1294 == class6) {
			if (aBoolean1297)
				throw new RuntimeException();
			if (is == null)
				Class39_Sub10.method866(anInt1298, this, 255, true, anInt1301, (byte) 90, (byte) 0);
			else {
				Class23.aCRC32_421.reset();
				Class23.aCRC32_421.update(is, 0, is.length);
				int i_9_ = (int) Class23.aCRC32_421.getValue();
				if (i_9_ != anInt1301)
					Class39_Sub10.method866(anInt1298, this, 255, true, anInt1301, (byte) 74, (byte) 0);
				else {
					this.method168(is, (byte) -127);
					method178((byte) -29);
				}
			}
		} else {
			if (!bool && anInt1300 == i)
				aBoolean1297 = true;
			if (is == null || is.length <= 2) {
				aBooleanArray1284[i] = false;
				if (aBoolean1288 || bool)
					Class39_Sub10.method866(i, this, anInt1298, bool, anIntArray145[i], (byte) 108, (byte) 2);
			} else {
				Class23.aCRC32_421.reset();
				Class23.aCRC32_421.update(is, 0, is.length - 2);
				int i_10_ = (int) Class23.aCRC32_421.getValue();
				int i_11_ = ((is[is.length - 1] & 0xff) + ((is[is.length - 2] & 0xff) << 8));
				if (i_10_ != anIntArray145[i] || i_11_ != anIntArray144[i]) {
					aBooleanArray1284[i] = false;
					if (aBoolean1288 || bool)
						Class39_Sub10.method866(i, this, anInt1298, bool, anIntArray145[i], (byte) 99, (byte) 2);
				} else {
					aBooleanArray1284[i] = true;
					if (bool)
						aByteArrayArray137[i] = is;
				}
			}
		}
	}

	public static void method174(int i) {
		Class15.aClass49_283 = new Deque();
	}

	public void method175(byte[] is, boolean bool, byte i, boolean bool_12_, int i_13_) {
		if (bool_12_) {
			if (aBoolean1297)
				throw new RuntimeException();
			if (aClass6_1294 != null)
				Class67.method1109(aClass6_1294, false, anInt1298, is);
			this.method168(is, (byte) -104);
			method178((byte) -29);
		} else {
			is[is.length - 2] = (byte) (anIntArray144[i_13_] >> 8);
			is[is.length - 1] = (byte) anIntArray144[i_13_];
			if (aClass6_1282 != null) {
				Class67.method1109(aClass6_1282, false, i_13_, is);
				aBooleanArray1284[i_13_] = true;
			}
			if (bool)
				aByteArrayArray137[i_13_] = is;
		}
	}

	public CacheArchive(CacheIO archiveIOHandler, CacheIO class6_14_, int i, boolean bool, boolean bool_15_, boolean bool_16_) {
		super(bool, bool_15_);
		aClass6_1282 = archiveIOHandler;
		aBoolean1288 = bool_16_;
		aClass6_1294 = class6_14_;
		anInt1298 = i;
		Class62_Sub2.method1077(30653, this, anInt1298);
	}

	public static void method176(byte i) {
		aClass3_1299 = null;
		aClass3_1286 = null;
		aClass3_1281 = null;
		aClass3_1293 = null;
		aClass39_Sub5_Sub10_Sub4Array1296 = null;
		aClass3_1292 = null;
		aClass3_1291 = null;
		aClass3_1289 = null;
		anIntArray1295 = null;
		aClass39_Sub5_Sub3_1285 = null;
	}

	public int method177(int i) {
		if (aBoolean1297)
			return 100;
		if (aByteArrayArray137 != null)
			return 99;
		int i_17_ = Class30.method319(255, anInt1298, -20500);
		if (i_17_ >= 100)
			i_17_ = 99;
		return i_17_;
	}

	public void method178(byte i) {
		aBooleanArray1284 = new boolean[aByteArrayArray137.length];
		for (int i_18_ = 0; aBooleanArray1284.length > i_18_; i_18_++)
			aBooleanArray1284[i_18_] = false;
		if (aClass6_1282 == null)
			aBoolean1297 = true;
		else {
			anInt1300 = -1;
			if (i == -29) {
				for (int i_19_ = 0; aBooleanArray1284.length > i_19_; i_19_++) {
					if (anIntArray134[i_19_] > 0) {
						Class35.method347(true, aClass6_1282, this, i_19_);
						anInt1300 = i_19_;
					}
				}
				if (anInt1300 == -1)
					aBoolean1297 = true;
			}
		}
	}

	static {
		aClass3_1281 = Class39_Sub5_Sub9.createJString(113, "Hidden");
		aClass3_1291 = Class39_Sub5_Sub9.createJString(113, "Your account has been disabled)3");
		aClass3_1289 = Class39_Sub5_Sub9.createJString(111, "leuchten2:");
		anIntArray1295 = new int[50];
		anInt1290 = 0;
		aClass3_1292 = Class39_Sub5_Sub9.createJString(123, "Ihr Spielkonto wurde deaktiviert)3");
		anInt1283 = 0;
		aClass3_1299 = aClass3_1281;
		aClass3_1286 = aClass3_1291;
		aClass3_1293 = Class39_Sub5_Sub9.createJString(118, ":tradereq:");
		anInt1302 = 0;
		anInt1303 = 0;
	}
}
